﻿@using Microsoft.Web.Mvc
@using SapaFinance.DTO
@using SapaFinance.UI.Controllers
@model CorporationDTO
<fieldset>
    <legend>Карточка юр.лица</legend>
    @Html.HiddenFor(c => c.UID)
    @{
        if (@Model.UID != Guid.Empty)
        {
            Html.RenderPartial("EditorTemplates/ChangableDTO", @Model);
        }
    }
    <table>
        <tr>
            <td>
                <div class="display-label">@Html.LabelFor(m => @Model.Name) @Html.ValidationMessageFor(x => x.Name)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Name)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.FullName) @Html.ValidationMessageFor(x => x.FullName)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.FullName)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.SelectedAgent)</div>
                @{ Html.RenderAction<AgentController>(x => x.RenderAgent(@Model.SelectedAgent)); }
                <div class="display-label">@Html.ValidationMessageFor(x => @Model.SelectedAgent)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.LegalAddress) @Html.ValidationMessageFor(x => x.LegalAddress)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.LegalAddress)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.ActualAddress)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.ActualAddress)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.Tin) @Html.ValidationMessageFor(x => x.Tin)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Tin)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.Kpp) @Html.ValidationMessageFor(x => x.Kpp)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Kpp)</div>
            </td>
            <td>
                <div class="display-label">@Html.LabelFor(m => @Model.Okonh)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Okonh)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.Okpo)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Okpo)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.Description)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.Description)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.RegistrationDate)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.RegistrationDate)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.IsHidden)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.IsHidden)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.DirectorName)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.DirectorName)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.AccountantName)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.AccountantName)</div>
                <div class="display-label">@Html.LabelFor(m => @Model.IsPayer)</div>
                <div class="editor-field">@Html.EditorFor(m => @Model.IsPayer)</div>
            </td>
            <td>
                @{ Html.RenderAction<CfoController>(x => x.RenderCfoTree(@Model.UID)); }
            </td>
        </tr>
    </table>
</fieldset>
